package cn.wolfcode.p2p.business.controller;

import cn.wolfcode.p2p.business.service.IBidRequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 首页
 */
@Controller
public class IndexController {

    @Autowired
    private IBidRequestService bidRequestService;

    @RequestMapping("index")
    public String main(Model model){
        model.addAttribute("publishPendngBidRequests",bidRequestService.queryByStateAndPublishTime());
        model.addAttribute("bidRequests",bidRequestService.queryBiddingByState());
        model.addAttribute("expBidRequests",bidRequestService.queryExpBiddingByState());
        return "main";
    }
}
